

package jetbrains.buildServer.server.graphql.model.agentPool.actions;

import org.jetbrains.annotations.Nullable;

public class AgentPoolActionStatus {
  public static AgentPoolActionStatus available() {
    return new AgentPoolActionStatus(true, null);
  }

  public static AgentPoolActionStatus unavailable(@Nullable AgentPoolActionUnavailabilityReason reason) {
    return new AgentPoolActionStatus(false, reason);
  }

  private final boolean myAvailable;
  private final AgentPoolActionUnavailabilityReason myReason;
  private AgentPoolActionStatus(boolean isAvailable, @Nullable AgentPoolActionUnavailabilityReason reason) {
    myAvailable = isAvailable;
    myReason = reason;
  }

  public boolean isAvailable() {
    return myAvailable;
  }

  @Nullable
  public AgentPoolActionUnavailabilityReason getUnavailabilityReason() {
    return myReason;
  }
}